import {Component, OnInit} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../../environments/environment';

@Component({
  selector: 'app-index',
  templateUrl: './index.component.html',
  styleUrls: ['./index.component.scss']
})
export class IndexComponent implements OnInit {
  msg: any;

  constructor(private http: HttpClient) {
  }

  ngOnInit() {
    const url = environment.url;
    this.http.get('http://localhost:8080/api/').subscribe(res => {
      console.log(res);
      this.msg = res['data'];
    }, err => {
      console.log(err);
    });
  }

}
